import request from "@/utils/request";

export function listCustom(params){
  return request({
    url: '/custom/info/list',
    method: 'GET',
    params: params
  })
}

export function selectNotAllocatedCustomList(params){
  return request({
    url: '/custom/info/selectNotAllocatedCustomList',
    method: 'get',
    params: params
  })
}

export function selectMySignedCustomList() {
  return request({
    url: '/custom/info/selectMySignedCustomList',
    method: 'get'
  })
}

export function getCustomInfo(id){
  return request({
    url: '/custom/info/' + id,
    method: 'GET'
  })
}

export function getCustomAgreementList(){
  return request({
    url: '/custom/info/getCustomAgreementList',
    method: 'get'
  })
}

export function addCustom(data){
  return request({
    url: '/custom/info',
    method: 'POST',
    data: data
  })
}

export function updateCustom(data){
  return request({
    url: '/custom/info',
    method: 'PUT',
    data: data
  })
}

export function deleteCustom(id){
  return request({
    url: '/custom/info/' + id,
    method: 'DELETE'
  })
}

// 导出客户
export function exportCustom(query) {
  return request({
    url: '/custom/info/export',
    method: 'get',
    params: query
  })
}

export function abandonCustom(data){
  return request({
    url: '/custom/info/abandonCustom',
    method: 'post',
    data: data
  })
}

export function claimCustom(ids) {
  return request({
    url: '/custom/info/claimCustom/' + ids,
    method: 'get'
  })
}

export function handoverCustom(data){
  return request({
    url: '/custom/info/handoverCustom',
    method: 'post',
    data: data
  })
}

export function intentCustom(id) {
  return request({
    url: '/custom/info/intentCustom/' + id,
    method: 'get'
  })
}

export function intentCustoms(ids) {
  return request({
    url: '/custom/info/intentCustoms/' + ids,
    method: 'get'
  })
}

export function signCustom(id) {
  return request({
    url: '/custom/info/signCustom/' + id,
    method: 'get'
  })
}

export function signCustoms(ids) {
  return request({
    url: '/custom/info/signCustoms/' + ids,
    method: 'get'
  })
}

export function listContact(customId) {
  return request({
    url: '/custom/contact/selectCustomContactByCustomId/' + customId,
    method: 'GET'
  })
}

export function getContactInfo(id){
  return request({
    url: '/custom/contact/' + id,
    method: 'GET'
  })
}

export function addContact(data) {
  return request({
    url: '/custom/contact',
    method: 'POST',
    data: data
  })
}

export function updateContact(data){
  return request({
    url: '/custom/contact',
    method: 'PUT',
    data: data
  })
}

export function deleteContact(id){
  return request({
    url: '/custom/contact/' + id,
    method: 'DELETE'
  })
}

export function selectFollow(customId){
  return request({
    url: '/custom/follow/list/' + customId,
    method: 'get'
  })
}

export function insertFollow(data){
  return request({
    url: '/custom/follow',
    method: 'post',
    data: data
  })
}

export function updateFollow(data){
  return request({
    url: '/custom/follow',
    method: 'put',
    data: data
  })
}

export function deleteFollow(id){
  return request({
    url: '/custom/follow/' + id,
    method: 'delete'
  })
}


export function selectFollowList(query){
  return request({
    url: '/custom/follow/selectFollowList',
    method: 'get',
    params: query
  })
}

export function selectMyCustomCount(query){
  return request({
    url: '/custom/info/selectMyCustomCount',
    method: 'get',
    params: query
  })
}

export function assignOperators(data){
  return request({
    url: '/custom/info/assignOperators',
    method: 'put',
    data: data
  })
}

export function transferOperators(data){
  return request({
    url: '/custom/info/transferOperators',
    method: 'put',
    data: data
  })
}

export function selectOperatorShop(query){
  return request({
    url: '/custom/info/selectOperatorShop',
    method: 'get',
    params: query
  })
}

export function selectLeaderShop(query){
  return request({
    url: '/custom/info/selectLeaderShop',
    method: 'get',
    params: query
  })
}

export function updateCustomOperStatus(data){
  return request({
    url: 'custom/info/updateCustomOperStatus',
    method: 'post',
    data: data
  })
}

export function importExcel(data){
  return request({
    url: '/custom/info/importExcel',
    method: 'post',
    data: data
  })
}

export function exportShop(query){
  return request({
    url: '/custom/info/exportShop',
    method: 'get',
    params: query
  })
}

export function exportShopAccordOperator(query){
  return request({
    url: '/custom/info/exportShopAccordOperator',
    method: 'get',
    params: query
  })
}

export function insertCustomByOperator(data){
  return request({
    url: '/custom/info/insertCustomByOperator',
    method: 'post',
    data: data
  })
}
